package cn.itcast.bos.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import cn.itcast.bos.domain.base.Courier;

@Repository
public interface CourierRepository extends JpaRepository<Courier, Integer>,JpaSpecificationExecutor<Courier> {
	
	//在CourierRepository接口中自定义数据库表的操作
	@Query(value="update Courier set deltag = '1' where id = ?")
	@Modifying  //表示是进行修改的查询语句
	public void updateDelTag(int id);
	
	@Query(value="update Courier set deltag = null where id = ?")
	@Modifying  //表示是进行修改的查询语句
	public void restoreDelTag(int id);
}
